//
//  XLBMHCashOutCell.m
//  XiangLove
//
//  Created by 宋振 on 2018/8/2.
//  Copyright © 2018年 BAOMIHUA.COM. All rights reserved.
//

#import "XLBMHCashOutCell.h"

@implementation XLBMHCashOutCell
{
    UILabel *_titleLbl;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self setCustomeView];
    }
    
    return self;
}

#pragma mark    -   -   - 绘制界面显示 -  -   -

/**
 绘制主要显示
 */
- (void)setCustomeView
{
    //标题显示
    _titleLbl = [[UILabel alloc] init];
    
    [self.contentView addSubview:_titleLbl];
    
    _titleLbl.font = [UIFont systemFontOfSize:17];
    _titleLbl.textColor = [UIColor colorWithRed:17/255.0 green:17/255.0 blue:17/255.0 alpha:1];
    _titleLbl.text = self.title;
    
    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.contentView.mas_left).offset(15);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.height.mas_equalTo(24);
        
    }];
    
    //arrow
    UIImageView *arrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"xl_arrow_icon"]];
    
    [self.contentView addSubview:arrow];
    
    [arrow mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.right.equalTo(self.contentView.mas_right).offset(-7);
        make.size.mas_equalTo(CGSizeMake(24, 24));
    }];
    
    //卡券个数显示
    self.countLbl = [[UILabel alloc] init];
    self.countLbl.textColor = RGB(153, 153, 153);
    self.countLbl.textAlignment = NSTextAlignmentRight;
    self.countLbl.font = [UIFont fontWithName:@"PingFangSC-Medium" size:15];
    self.countLbl.hidden = YES;
    [self.contentView addSubview:self.countLbl];
    
    [self.countLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.right.equalTo(arrow.mas_left).offset(-2);
        make.height.mas_equalTo(21);
    }];
    
}


- (void)setTitle:(NSString *)title
{
    _title = title;
    
    _titleLbl.text = title;
}








- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
